package com.group3.group3.baobiao.hrbor.control;

import com.group3.group3.baobiao.hrbor.entity.HarborinfoSearchEnity;
import com.group3.group3.baobiao.hrbor.service.HarborinfoService;
import com.group3.group3.mybatis.entity.CoalHarborEntity;
import com.group3.group3.mybatis.flexigrid.PadingRstType;
import com.group3.group3.mybatis.flexigrid.PagingBean;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author Hhw-byte
 * @create 2022-05-16 11:08
 */
@Controller
@RequestMapping("/hrbor")
public class HarborinfoController {
    private Logger logger =  LogManager.getLogger(this.getClass().getName());
    @Resource
    private HarborinfoService harborinfoService;
    @Secured("ROLE_gqgy_data_hrbor")

    @RequestMapping("/page")
    public String userPage(){
        return "hrbor/hrborpage";
    }

    @RequestMapping("/getharborinfoInfoListByPage")
    @ResponseBody
    public PadingRstType<CoalHarborEntity> getharborinfoInfoListByPage(HarborinfoSearchEnity search, PagingBean paging){
        logger.info(search);
        PadingRstType<CoalHarborEntity> CoalHarborEntityPadingRstType = harborinfoService.getharborinfoInfoListByPage(search,paging);
        return CoalHarborEntityPadingRstType;
    }
}
